Perf: Optimize member handling in collectives with a large number of members#2518
Open
Koc wants to merge 2 commits into
Open
Perf: Optimize member handling in collectives with a large number of members#2518Koc wants to merge 2 commits into
Koc wants to merge 2 commits into
Conversation
mejo-
requested changes
May 26, 2026
9fd8790 to
0f02d43
Compare
Contributor
Author
|
@mejo- heh, it seems like that topic is much more complex. I've updated the PR description and pushed more changes. Please, re-review |
…rge number of members Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
0f02d43 to
0cc7584
Compare
…rge number of members (in-place updates) Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
0cc7584 to
66c9f24
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary
This is continuation of #2443.
I've generated 1200 users using
./occ user:addand assigned them to a single collective using./occ circles:members:add. Here are my findings:1. Members list endpoint works really slow
I had an attempt to implement lightweight API endpoint in circles module but stuck with it due to federated users. This is a really loong path which I'd prefer to avoid. Also keep in mind that we're reloading this members list every 1 minute due to background fetcher and endpoint latency goes up to 10s in our organization.
So, instead of that we're loading only 15 users for a landing page. And then re-loading all users once we toggle editor mode from preview to edit. This improves performance of BE without degradation of the users autocomplete functionality in the editor.
Feel the difference 😃

2. vDOMException: The quota has been exceeded
This happens because we store
circlesMembersin the local storage. I've changed it to a local variable. As an option - we can store same 15 users but this would add even more complexity.At the same time we're still store tons of keys like
nextcloud_per_bmV4dGNsb3Vk_user-has-avatar.adminbut this is a separate topic, let's handle it in the follow-up PRs.3. There is no skeleton loading in the member picker popup
We have bad UX as endpoint can respond up to 10s in our case. I've added it
4. Full list reloading for an every member change
Every member change like add/remove/change level causes full list reloading. As we already mentioned - this is slow operation. When we managing large circle it becomes a nightmare. So I've added in-place update to state instead of full re-fetching.
Adding of new member looks a bit ugly, maybe we can improve that in the follow-up PRs by adding extra parameter to refetch a single user
🏁 Checklist
npm run lint/npm run stylelint/composer run cs:check)🤖 AI (if applicable)